import jieba

with open("三国演义.txt","r",encoding="utf-8") as f:
    text=f.read()

words=jieba.lcut(text)
word_count={}
for word in words:
    if len(word)>1:
        word_count[word]=word_count.get(word,0)+1

sorted_words=sorted(word_count.items(),key=lambda x:x[1],reverse=True)
for word, freq in sorted_words[:20]:
    print(f"{word}:freq")